Skip to main content
ICT
Lesson A12 - Iterations
 
Main Previous Next
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

LAB ASSIGNMENT A12.3 page 14 of 18

LoanTable

Background:

When buying a home, a very important financial consideration that many buyers face is obtaining a qualifying loan from a financial institution. Interest rates can be fixed or variable and there are service charges called ‘points’ for taking out a loan. One ‘point’ is equal to 1% of the loan amount (called principal) borrowed. Taking out a loan of $150,000 with a 2 point charge will amount to a cost of $3,000 for obtaining the loan - before you ever make your first mortgage payment! Some banks and financial lending institutions offer lower interest rates but require higher points, and vice versa. Usually, the more points you pay, the lower the interest rate. It is helpful to know what the monthly mortgage payment will be for a given loan amount with different interest rates.

The monthly payment on a loan is determined using three inputs:

  1. The amount of the loan (principal).

  2. The number of years for the loan to be paid off.

  3. The annual interest rate of the loan.

The formula for determining payments is:

p = principal, amount borrowed
k = monthly interest rate (annual rate/12.0)
n = number of monthly payments (years * 12)
c = (1 + k)n
a = monthly payment (interest and principal paid)

Assignment:

  1. Write a program that prompts the user for the following information:

    1. The amount of the loan
    2. The length of the loan in years
    3. A low interest rate in %
    4. A high interest rate in %
  2. Print out the monthly payment for the different interest rates from low to high, incremented by 0.25%.

  3. Run the following three samples and copy the sample runs into your class file, print out the code for the class and hand in.

    Mortgage problem

    Principal = $100000.00
    Time = 30 years
    Low rate = 11%
    High rate = 12%

    Annual Interest Rate
    Monthly Payment
    11.00
     952.32
    11.25
     971.26
    11.50
     990.29
    11.75
    1009.41
    12.00
    1028.61
  4. Your program should make use of the built-in pow method located in the Math class.

  5. Your program must make use of separate methods for the data input section and the printing section of the assignment.

Instructions:

  1. Write the program. Confirm that it works to the screen using the above sample output.

  2. Here are two sample sets of inputs.
Run 1: Principal
187450.00
  Low rate
8.00
  High rate
12.00
  Years
30     
   
Run 2: Principal
12000.00
  Low rate
10.00
  High rate
12.00
  Years
5     

 

Main Previous Next
Contact
 © ICT 2006, All Rights Reserved.